import { reactive } from 'vue'

interface LayoutSideState {
  // 侧边栏展开收起状态
  collapsed: boolean
  // 侧边栏收起宽度
  collapsedWidth: number
  // 侧边栏默认宽度
  width: number
}
interface LayoutState {
  side: LayoutSideState
}

// 布局状态管理
export const layoutState = reactive<LayoutState>({
  side: {
    collapsed: false,
    collapsedWidth: 50,
    width: 232
  }
})

export const toggleCollapsed = () => {
  layoutState.side.collapsed = !layoutState.side.collapsed
}
